import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'Login',
      component: () => import('./views/login/Login.vue')
    },
    {
      path: '/',
      name: 'MainLayout',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('./views/MainLayout.vue'),
      children: [
        {
          path: 'system',
          name: 'System',
          component: () => import('./views/system/System.vue')
        }
      ]
    }
  ]
})
